package com.ahwei.service.impl;

import com.ahwei.dao.user.CollectDao;
import com.ahwei.pojo.Collect;
import com.ahwei.service.CollectService;
import com.ahwei.util.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author：ahwei163@qq.com
 *
 * @date: 202*-03-20 12:57:29
 * @description: 这是一个Java文件！
 */
public class CollectServiceImpl implements CollectService {
    private final SqlSession sqlSession = MyBatisUtils.getSqlSession(true);
    private final CollectDao collectDao = sqlSession.getMapper(CollectDao.class);

    @Override
    public List<Collect> findCollectByUid(long uid) {
        return collectDao.findByUid(uid);
    }

    @Override
    public int addCollect(Collect collect) {
        return collectDao.add(collect);
    }

    @Override
    public int deleteCollect(long vid,long uid) {
        return collectDao.delete(vid,uid);
    }
}
